package com.itcast.n5_堆内存;

import java.io.IOException;
import java.util.ArrayList;

/**
 * @program: jvm
 * @description:
 * @author: flyduck
 * @create: 2024-09-23 10:13
 **/
//-Xmx4g -Xms4g
//Memory    used                      total                      max                        usage
//heap      124M                      3925M                      3925M                      3.17%
public class Test04_测试堆参数Xmx和Xms {
    public static void main(String[] args) throws IOException, InterruptedException {
        ArrayList<Object> objects = new ArrayList<Object>();
        System.in.read();
        while (true) {
            objects.add(new byte[1024 * 1024 * 100]);
            Thread.sleep(2000);
        }
    }
}
